;(function($){

	$.fn.advScroll = function(option) {
		
		$.fn.advScroll.option = {
			marginTop:-300,
			easing:'',
			timer:100,
		};

		option = $.extend({}, $.fn.advScroll.option, option);

		return this.each(function(){

			var el = $(this);

			$(window).scroll(function(){
				if($(window).scrollTop() > 300){
					if ($(window).scrollTop() > ($(document).height()-700)) {return;}
				t = parseInt($(window).scrollTop()) + option.marginTop;
				el.stop().animate({marginTop:t},option.timer,option.easing);
			}
			})
		});
	};

})(jQuery)
